<?php

namespace app\admin\controller;

use app\common\controller\Admin;

/**
 * 提现
 * Class Withdraw
 * @package app\admin\controller
 */
class Withdraw extends Admin
{

    /**
     * 提现首页
     * @return mixed
     */
    public function index()
    {
        $param = $this->request->param();
        $map = [];

//		$map['status'] = array('egt', 0);
//		if (isset($param['nickname']) && $param['nickname']) {
//			$map['nickname'] = array('like', '%' . $param['nickname'] . '%');
//		}
//		if (isset($param['username']) && $param['username']) {
//			$map['username'] = array('like', '%' . (string) $param['nickname'] . '%');
//		}

        if (isset($param['uid']) && $param['uid'] > 0) {
            $map['uid'] = intval($param['uid']);
        }

        $list = model('userWithdraw')->where($map)->order('id desc')
            ->paginate(15, false, array(
                'param' => $param
            ));

        $data = array(
            'list' => $list,
            'page' => $list->render(),
            'param' => $param
        );
        $this->assign($data);
        $this->setMeta('用户提现信息');
        return $this->fetch();
    }

}